package com.magenta.maxoptra.abstractions;

import java.util.Set;

import javax.annotation.processing.AbstractProcessor;
import javax.annotation.processing.RoundEnvironment;
import javax.annotation.processing.SupportedAnnotationTypes;
import javax.annotation.processing.SupportedSourceVersion;
import javax.lang.model.element.Element;
import javax.lang.model.element.TypeElement;
import javax.lang.model.SourceVersion;
import javax.tools.Diagnostic;

@SupportedAnnotationTypes({"javax.ejb.EJB", "javax.ejb.Stateless"})
@SupportedSourceVersion(SourceVersion.RELEASE_6)
public class ServicesProcessor extends AbstractProcessor {
	@Override
	public boolean process(Set<? extends TypeElement> annotations,
			RoundEnvironment roundEnv) {
		for (TypeElement typeElement : annotations) {
			for (Element element : roundEnv
					.getElementsAnnotatedWith(typeElement)) {
				this.processingEnv.getMessager().printMessage(
						Diagnostic.Kind.ERROR, "Hallo Welt!", element);
			}
		}
		return true;
	}
}
